package com.rfid.framework.web.service;

import com.rfid.system.domain.TCustomerInfo;
import com.rfid.system.domain.TProductInfo;
import com.rfid.system.service.ITCustomerInfoService;
import com.rfid.system.service.ITProductInfoService;
import net.sf.ehcache.util.ProductInfo;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName ProcuctService
 * @Description 产品信息
 * @Author fangchen
 * @Date 2020/12/9 15:19
 * @Version 1.0
 **/
@Service("productService")
public class ProcuctService {

    @Autowired
    private ITProductInfoService iTProductInfoService;


    @Autowired
    private ITCustomerInfoService tCustomerInfoService;

    public List<TProductInfo> getProductInfo(){
        List<TProductInfo> list=iTProductInfoService.selectTProductInfoList(null);
        if(CollectionUtils.isNotEmpty(list)){
            list.forEach(info->{
                info.setNameAndNo(info.getProductNo()+"("+info.getProductName()+")");
            });
        }
        return list;
    }

    public List<TCustomerInfo> getcustomerInfo(){
        List<TCustomerInfo> list=tCustomerInfoService.selectTCustomerInfoList(null);
        return list;
    }
}
